package com.tn.mqtt;

import org.springframework.beans.factory.InitializingBean;

/**
 * @ClassName AspCallback
 * @Description mqtt返回抽象类
 * @Author Yezhongzhu
 * @Date 2021/12/27 20:25
 * @Version v1.0
 **/
public abstract class AbstractBaseCallback extends Callback implements InitializingBean {
    /**
     * 获取当前子类对象
     * @return
     */
    protected abstract AbstractBaseCallback getClazz();

    /**
     * 获取当前子类监听队列
     * @return
     */
    protected abstract String getTopic();

    /**
     * 初始化bean
     * @throws Exception
     */
    @Override
    public void afterPropertiesSet() throws Exception {
        init(getTopic(),getClazz());
    }
}
